import { stringify } from 'qs';
import _ from 'lodash';
import request, { checkResultCode, checkStatus } from '../utils/request';
import { Constants } from '../utils';
import { ipConfig } from './config';

// http://mesdev.chalco-steering.com:1708/appgateway/api-ms/pub/todo/search?appId=APP_MES&status=2&page=9&rows=10&type=1

// export const serverName = '/api-pea-device-170236';
export const serverName = ipConfig.baseServerName();

export const imageUrl = `${serverName}/logistics/fileController/download/`; // 图片路径

const findToHomeUrl = `${serverName}/device/fualt/findTofailureHome`; // 首页故障列表

const findToHomeTodoUrl = `${serverName}/device/fualt/findToFailureWait`; // 首页故障待办列表

const findByMeUrl = `${serverName}/device/fualt/findByMe`; // 首页故障待办列表

const queryEquipmentByparamsUrl = `${serverName}/device/equipment/queryEquipmentByparams`; // 首页设备列表

const autoCreateFailureCodeUrl = `${serverName}/device/fualt/autoCreateFailureCode`; // 故障单号生成

const uploadUrl = `${serverName}/logistics/fileController/upload?token=`; // 文件上传

const uploadsUrl = `${serverName}/logistics/fileController/manyUpload?token=`; // 多文件上传

const declareFailureUrl = `${serverName}/device/fualt/declareFailure`; // 故障上报

const addPositionUrl = `${serverName}/device/splitItem/saveSplitItemType`; // 添加拆分位置

const findDraftDetailUrl = `${serverName}/device/fualt/findDraftDetail`; // 故障草稿查询

const delDraftUrl = `${serverName}/device/fualt/draftClose`; // 删除草稿

const getDeviceInfoUrl = `${serverName}/device/equipment/queryEquipmentByEquipmentCode`; // 获取设备信息接口

const getFacilitiesInfoUrl = `${serverName}/device/facility/byFacilityId`; // 获取设施信息接口

const findMmMaterialVoUrl = `${serverName}/materialLot/findMmMaterialVo`; // 获取备件信息

const incidentKeywordUrl = `${serverName}/failurekeywords/savePro`; // 故障申报添加关键字

const searchIncidentKeywordUrl = `${serverName}/failurekeywords/searchPro`; // 故障申报搜索关键字

const maintainCompleteIncidentReasonUrl = `${serverName}/causekeywords`; // 维修完成故障原因新增关键字

const searchMaintainCompleteIncidentReasonUrl = `${serverName}/causekeywords/search`; // 搜索维修完成故障原因关键字

const maintainCompleteProcessUrl = `${serverName}/maintkeywords`; // 维修完成处理过程新增关键字

const searchMaintainCompleteProcessUrl = `${serverName}/maintkeywords/search`; // 搜索维修完成处理过程关键字

const searchFacilitiesCategoryUrl = `${serverName}/cpsObjType/getFacility`; // 搜索设施类别

const addFacilitiesCategoryUrl = `${serverName}/cpsObjType/saveFacility`; // 添加设施类别

const searchFacilitiesUrl = `${serverName}/device/facility/byObjType`; // 搜索设施

const addFacilitiesUrl = `${serverName}/device/facility/save`; // 设施保存

const AuthCode = {
  appId: 'APP_MES',
};

// export const search = async params => {
//   const defaultParams = { ...AuthCode, rows: Constants.PAGE_SIZE, page: 1 };
//   const newParams = { ...defaultParams, ...params };
//   // return request(`${ipConfig.url(PATH)}?${stringify(newParams)}`, {
//   //   method: 'GET',
//   // }).then(mapList);
//   return {
//     list: [{ id: '001', name: '天车1', checked: true }, { id: '002', name: '天车2', checked: false }, { id: '002', name: '天车3', checked: false }, { id: '002', name: '天车4', checked: false }, { id: '002', name: '天车5', checked: false }],
//     page: 1,
//     total: 5,
//   };
// };

export const findToHome = async (params, choice) => {
  const defaultParams = { rows: Constants.PAGE_SIZE, page: 1 };
  const newParams = { ...defaultParams, ...params };
  let url = '';
  if (choice == 'all') {
    url = findToHomeUrl;
  } else if (choice == 'todo') {
    url = findToHomeTodoUrl;
  } else if (choice == 'my') {
    url = findByMeUrl;
  }
  // return request(`http://192.168.15.56:80/device/fualt/findTofailureHome?${stringify(newParams)}`, {
  return request(`${ipConfig.url(url)}?${stringify(newParams)}`, {
    method: 'GET',
  }).then(mapFindToHome);
};

// export const findToHomeTodo = async params => {
//   const defaultParams = { rows: Constants.PAGE_SIZE, page: 1 };
//   const newParams = { ...defaultParams, ...params };
//   return request(`${ipConfig.url(findToHomeTodoUrl)}?${stringify(newParams)}`, {
//     method: 'GET',
//   }).then(mapFindToHome);
// };

export const findMmMaterialVo = async params => {
  const defaultParams = { rows: Constants.PAGE_SIZE, page: 1 };
  const newParams = { ...defaultParams, ...params };
  return request(`${ipConfig.url(findMmMaterialVoUrl)}?${stringify(params)}`, {
    method: 'GET',
  }).then(mapFindMmMaterialVo);
};

export const findDraftDetail = async params => (
  // request('http://192.168.15.56:80/device/fualt/findDraftDetail', {
  request(`${ipConfig.url(findDraftDetailUrl)}`, {
    method: 'POST',
    body: params,
  }).then(mapFindDraftDetail)
);

export const delDraft = async params => (
  request(`${ipConfig.url(delDraftUrl)}?${stringify(params)}`, {
    method: 'GET',
  }).then(response => ({
    data: response.data,
  }))
);

export const queryEquipmentByparams = async params => {
  const defaultParams = {
    ...AuthCode, rows: Constants.PAGE_SIZE, page: 1, condition: '',
  };
  const newParams = { ...defaultParams, ...params };
  return request(`${ipConfig.url(queryEquipmentByparamsUrl)}?${stringify(newParams)}`, {
    method: 'GET',
  }).then(mapQueryEquipmentByparams);
};

export const getDeviceInfo = async params => {
  return request(`${ipConfig.url(getDeviceInfoUrl)}`, {
    method: 'POST',
    body: params,
  }).then(mapGetDeviceInfo);
};

export const getFacilitiesInfo = async params => {
  return request(`${ipConfig.url(getFacilitiesInfoUrl)}?${stringify(params)}`, {
    method: 'GET',
  }).then(mapFacilitiesInfo);
};

export const autoCreateFailureCode = async () => (
  request(`${ipConfig.url(autoCreateFailureCodeUrl)}`, {
    method: 'GET',
  }).then(response => ({
    code: response.data,
  }))
);

export const declareFailure = async params => {
  return request(`${ipConfig.url(declareFailureUrl)}`, {
  // return request('http://192.168.15.56:80/device/fualt/declareFailure', {
    method: 'POST',
    body: params,
  }).then(mapDeclareFailure);
};

export const addPosition = async params => {
  return request(`${ipConfig.url(addPositionUrl)}`, {
  // return request('http://192.168.18.217:80/device/splitItem/saveSplitItemType', {
    method: 'POST',
    body: params,
  }).then();
};

export const addKeyword = async (params, keyword, url) => {
  let result = null;
  if (url === 'incidentKeywordUrl') {
    const newParams = { failureKeywords: keyword, ...params };
    // result = request('http://192.168.15.56:80/failurekeywords/savePro', {
    result = request(`${ipConfig.url(incidentKeywordUrl)}`, {
      method: 'POST',
      body: newParams,
    }).then(response => mapIncidentKeyword(response, url));
  } else if (url === 'maintainCompleteIncidentReasonUrl') {
    const newParams = { causeKeywords: keyword, ...params };
    result = request(`${ipConfig.url(maintainCompleteIncidentReasonUrl)}`, {
      method: 'POST',
      body: newParams,
    }).then(response => mapIncidentKeyword(response, url));
  } else if (url === 'maintainCompleteProcessUrl') {
    const newParams = { maintKeywords: keyword, ...params };
    result = request(`${ipConfig.url(maintainCompleteProcessUrl)}`, {
      method: 'POST',
      body: newParams,
    }).then(response => mapIncidentKeyword(response, url));
  } else if (url === 'facilitiesCategory') {
    const newParams = { objTypeName: keyword, ...params };
    result = request(`${ipConfig.url(addFacilitiesCategoryUrl)}`, {
      method: 'POST',
      body: newParams,
    }).then(response => mapIncidentKeyword(response, url));
  } else if (url === 'facilities') {
    const newParams = { facilityName: keyword, ...params };
    result = request(`${ipConfig.url(addFacilitiesUrl)}`, {
      method: 'POST',
      body: newParams,
    }).then(response => mapIncidentKeyword(response, url));
  }
  return result;
};

export const choiceSearch = async (params, url) => {
  const defaultParams = { ...AuthCode, rows: Constants.PAGE_SIZE, page: 1, isHomeQueryFlag: false };
  let newParams = { ...defaultParams, ...params };
  let result = null;
  if (url === `${serverName}/device/fualt/queryMaintOrg`) {
    result = request(`${ipConfig.url(url)}?orgName=${params.condition}`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  } else if (url === '/api-ms/system/organizations/findOrgByType?orgType=Safe') { // 获取安全部门
    result = request(`${ipConfig.url(url)}`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  } else if (url === '/api-ms/system/organizations/findOrg') { // 获取部门
    newParams.orgName = newParams.condition;
    result = request(`${ipConfig.url(url)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  } else if (url === `${serverName}/materialDefinition/lists`) {
    result = request(`${ipConfig.url(url)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  } else if (url === `${serverName}/infoWarehouse/topHouse`) {
  // } else if (url === 'http://192.168.15.56:80/infoWarehouse/topHouse') {
    result = request(`${ipConfig.url(url)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  // } else if (url === `${serverName}/stockLogCtrl/staff`) {
  } else if (url === '/api-ms/system/staffs/search') {
    newParams.name = newParams.condition;
    result = request(`${ipConfig.url(url)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  } else if (url === `${serverName}/stockLogCtrl/toWarehouse`) {
  // } else if (url === 'http://192.168.15.56:80/stockLogCtrl/toWarehouse') {
    // newParams = { rows: Constants.PAGE_SIZE, page: 1, ...params };
    newParams = { condition: params.condition };
    result = request(`${ipConfig.url(url)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  } else if (url.includes('http://') || url.includes('https://')) {
    result = request(`${url}?name=合金6&page=1&rows=10`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  } else {
    result = request(`${ipConfig.url(url)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceSearch(response, url));
  }

  return result;
};

export const choiceKeywordSearch = async (params, url) => {
  const defaultParams = { rows: Constants.PAGE_SIZE, page: 1 };
  const newParams = { ...defaultParams, ...params };
  let result = null;
  if (url === 'incidentKeywordUrl') {
    // `${ipConfig.url(searchIncidentKeywordUrl)}?${stringify(newParams)}`
    result = request(`${ipConfig.url(searchIncidentKeywordUrl)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceKeywordSearch(response, url));
  } else if (url === 'maintainCompleteIncidentReasonUrl') {
    result = request(`${ipConfig.url(searchMaintainCompleteIncidentReasonUrl)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceKeywordSearch(response, url));
  } else if (url === 'maintainCompleteProcessUrl') {
    result = request(`${ipConfig.url(searchMaintainCompleteProcessUrl)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceKeywordSearch(response, url));
  } else if (url === 'facilitiesCategory') {
    // `${ipConfig.url(searchFacilitiesCategoryUrl)}?${stringify(newParams)}`
    result = request(`${ipConfig.url(searchFacilitiesCategoryUrl)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceKeywordSearch(response, url));
  } else if (url === 'facilities') {
    // `${ipConfig.url(searchFacilitiesUrl)}?${stringify(newParams)}`
    result = request(`${ipConfig.url(searchFacilitiesUrl)}?${stringify(newParams)}`, {
      method: 'GET',
    }).then(response => mapChoiceKeywordSearch(response, url));
  }
  return result;
};

export const uploadPic = async files => {
  const formData = new FormData();

  files.forEach(file => {
    formData.append('file', file);
  });
  return fetch(`${ipConfig.url(uploadUrl)}${global.__TOKEN_ACCESS__}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8',
    },
    body: formData,
  }).then(checkStatus)
    .then(response => (response.json()))
    .then(checkResultCode)
    .then(response => {
      const res = {
        success: true,
        data: response.data,
      };
      return res;
    })
    .catch(error => {
      console.warn(error);
      const res = {
        success: false,
        error,
      };
      return res;
    });
};

export const uploadPics = async files => {
  const formData = new FormData();

  files.forEach(file => {
    formData.append('file', file);
  });
  return fetch(`${ipConfig.url(uploadsUrl)}${global.__TOKEN_ACCESS__}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8',
    },
    body: formData,
  }).then(checkStatus)
    .then(response => (response.json()))
    .then(checkResultCode)
    .then(response => {
      const res = {
        success: true,
        data: response.data,
      };
      return res;
    })
    .catch(error => {
      console.warn(error);
      const res = {
        success: false,
        error,
      };
      return res;
    });
};

const mapChoiceSearch = (response, url) => {
  let data = null;
  if (url === `${serverName}/device/equipment/queryEquipmentByparams`) {
    data = _.map(response.data, it => ({
      id: it.equipmentId,
      code: it.equipmentCode,
      name: it.equipmentName,
      equipObjType: it.objType,
      maintOrgId: it.maintOrgId,
      maintOrgName: it.maintOrgName,
      checked: false,
    }));
  } else if (url === `${serverName}/materialDefinition/lists`) {
    data = _.map(response.data, it => ({
      id: it.materialId,
      code: it.materialCode1,
      name: it.materialName,
      checked: false,
    }));
  } else if (url === '/api-ms/system/organizations/findOrgByType?orgType=Safe') {
    data = _.map(response.data.orgTypeInfo, it => ({
      id: it.orgId,
      code: it.orgCode,
      name: it.orgName,
      checked: false,
    }));
  } else if (url === '/api-ms/system/organizations/findOrg') {
    data = _.map(response.data, it => ({
      id: it.orgId,
      code: it.orgCode,
      name: it.orgName,
      checked: false,
    }));
  } else if (url === `${serverName}/device/fualt/queryMaintOrg`) {
    data = _.map(response.data, it => ({
      id: it.orgId,
      code: it.orgCode,
      name: it.orgName,
      checked: false,
    }));
  } else if (url.includes(`${serverName}/device/fualt/associativeQueryFailureDesc`)) {
    data = _.map(response.data, it => ({
      id: '',
      name: it,
      checked: false,
    }));
  } else if (url === `${serverName}/infoWarehouse/topHouse`) {
  // } else if (url === 'http://192.168.15.56:80/infoWarehouse/topHouse') {
    data = _.map(response.data, it => ({
      id: '',
      name: it,
      checked: false,
    }));
  // } else if (url === `${serverName}/stockLogCtrl/staff`) {
  } else if (url === '/api-ms/system/staffs/search') {
    data = _.map(response.data, it => ({
      id: it.staffId,
      name: it.name,
      orgId: it.orgId,
      orgName: it.orgName,
      checked: false,
    }));
  } else if (url === `${serverName}/stockLogCtrl/toWarehouse`) {
  // } else if (url === 'http://192.168.15.56:80/stockLogCtrl/toWarehouse') {
    data = _.map(response.data, it => ({
      id: '',
      name: it,
      checked: false,
    }));
  } else if (url.includes('http://') || url.includes('https://')) {
    data = _.map(response.data, it => ({
      id: it.staffId,
      code: it.staffNo,
      name: it.name,
      checked: false,
    }));
  }

  return {
    list: data,
    page: response.pageNum,
    total: response.totalNum,
  };
};

const mapChoiceKeywordSearch = (response, url) => {
  let data = null;
  if (url === 'incidentKeywordUrl') {
    data = _.map(response.data, it => ({
      id: it.failureKeywordsId,
      name: it.failureKeywords,
      times: it.times,
    }));
  } else if (url === 'maintainCompleteIncidentReasonUrl') {
    data = _.map(response.data, it => ({
      id: it.causeKeywordsId,
      name: it.causeKeywords,
      times: it.times,
    }));
  } else if (url === 'maintainCompleteProcessUrl') {
    data = _.map(response.data, it => ({
      id: it.maintKeywordsId,
      name: it.maintKeywords,
      times: it.times,
    }));
  } else if (url === 'facilitiesCategory') {
    data = _.map(response.data, it => ({
      id: it.objType,
      name: it.objTypeName,
    }));
  } else if (url === 'facilities') {
    data = _.map(response.data, it => ({
      id: it.facilityId,
      name: it.facilityName,
    }));
  }

  return {
    list: data,
    page: response.pageNum,
    total: response.totalNum,
  };
};

const mapFindToHome = response => {
  // `http://gateway.pea.cs2025.cn/gateway/api-pea-device/logistics/fileController/download/402892e468596e98016859ccbbc6000d?token=1d3382ef-81ee-47d5-b12e-d8e442361743`
  const data = _.map(response.data, it => ({
    _id: it.failureId,
    failureCode: it.failureCode,
    failureStatusDesc: it.failureStatusDesc,
    failureStatus: it.failureStatus,
    failureType: it.failureType,
    failureKeywords: it.failureKeywords,
    equipmentCode: it.equipmentCode,
    equipmentName: it.equipmentName,
    facilityName: it.facilityName,
    facilityId: it.facilityId,
    equipmentId: it.equipmentId,
    failureDesc: it.failureDesc,
    failureLevel: it.failureLevel,
    declareTime: it.declareTime,
    maintOrgId: it.maintOrgId,
    reporter: it.reporter,
    failurePic: it.failurePic ? `${ipConfig.url(imageUrl)}${it.failurePic}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
  }));

  return {
    list: data,
    page: response.pageNum,
    total: response.totalNum,
  };
};

const mapFindMmMaterialVo = response => {
  // `http://gateway.pea.cs2025.cn/gateway/api-pea-device/logistics/fileController/download/2c94b38a673f928801673fe2b5250011?token=${global.__TOKEN_ACCESS__}`
  // const data = _.map(response.data, it => ({
  //   materialId: it.materialId,
  //   lotCode: it.lotCode,
  //   inDate: it.inDate,
  //   manufacturerId: it.manufacturerId,
  //   manufacturerName: it.manufacturerName,
  //   materialCode: it.materialCode,
  //   materialLotId: it.materialLotId,
  //   materialName: it.materialName,
  //   materialSpecModel: it.materialSpecModel,
  //   outDate: it.outDate,
  //   supplierId: it.supplierId,
  //   supplierName: it.supplierName,
  //   photos: it.photos ? `${ipConfig.url(imageUrl)}${it.photos}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
  //   photos1: it.photos1 ? `${ipConfig.url(imageUrl)}${it.photos1}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
  //   photos2: it.photos2 ? `${ipConfig.url(imageUrl)}${it.photos2}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
  // }));

  // return {
  //   list: data,
  //   page: response.pageNum,
  //   total: response.totalNum,
  // };

  let data = null;
  if (response.data) {
    data = {
      materialId: response.data.materialId,
      lotCode: response.data.lotCode,
      inDate: response.data.inDate,
      manufacturerId: response.data.manufacturerId,
      manufacturerName: response.data.manufacturerName,
      materialCode: response.data.materialCode,
      materialLotId: response.data.materialLotId,
      materialName: response.data.materialName,
      materialSpecModel: response.data.materialSpecModel,
      outDate: response.data.outDate,
      batchGranularity: response.data.batchGranularity,
      supplierId: response.data.supplierId,
      supplierName: response.data.supplierName,
      photos: response.data.photos ? `${ipConfig.url(imageUrl)}${response.data.photos}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
      photos1: response.data.photos1 ? `${ipConfig.url(imageUrl)}${response.data.photos1}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
      photos2: response.data.photos2 ? `${ipConfig.url(imageUrl)}${response.data.photos2}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
    };
  }
  return data;
};

const mapGetDeviceInfo = response => {
  let data = null;
  if (response.data) {
    data = {
      id: response.data.equipmentId,
      code: response.data.equipmentCode,
      name: response.data.equipmentName,
      equipObjType: response.data.objType,
      maintOrgId: response.data.maintOrgId,
      maintOrgName: response.data.maintOrgName,
    };
  }
  return data;
};

const mapFacilitiesInfo = response => {
  let data = null;
  if (response.data) {
    data = {
      objType: response.data.objType,
      facilityTypeName: response.data.facilityTypeName,
      facilityId: response.data.facilityId,
      facilityName: response.data.facilityName,
    };
  }
  return data;
};

const mapQueryEquipmentByparams = response => {
  const data = _.map(response.data, it => ({
    _id: it.equipmentId,
    equipmentCode: it.equipmentCode,
    equipmentName: it.equipmentName,
    equipmentLevel: it.equipmentLevel,
    maintOrgId: it.maintOrgId,
    userOrgDepartment: it.userOrgDepartment,
    maintOrgName: it.maintOrgName,
    status: it.status,
    objType: it.objType,
    equipmentImage: it.equipmentImage ? `${ipConfig.url(imageUrl)}${it.equipmentImage}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
  }));
  return {
    list: data,
    page: response.pageNum,
    total: response.totalNum,
  };
};

const mapDeclareFailure = response => {
  // alert(JSON.stringify(response.data));
  console.log(JSON.stringify(response.data));
  // const data = _.map(response.data, it => ({
  //   failureCode: it.failureCode,
  // }));
  return {
    failureId: response.data.failureId,
    failureCode: response.data.failureCode,
    success: true,
  };
};

const mapIncidentKeyword = (response, url) => {
  let data = null;
  if (url === 'incidentKeywordUrl') {
    data = {
      id: response.data.failureKeywordsId,
      name: response.data.failureKeywords,
    };
  } else if (url === 'maintainCompleteIncidentReasonUrl') {
    data = {
      id: response.data.causeKeywordsId,
      name: response.data.causeKeywords,
    };
  } else if (url === 'maintainCompleteProcessUrl') {
    data = {
      id: response.data.maintKeywordsId,
      name: response.data.maintKeywords,
    };
  } else if (url === 'facilitiesCategory') {
    data = {
      id: response.data.objType,
      name: response.data.objTypeName,
    };
  } else if (url === 'facilities') {
    data = {
      id: response.data.facilityId,
      name: response.data.facilityName,
    };
  }

  return data;
};

const mapFindDraftDetail = response => {
  // const data = _.map(response.data, it => ({
  //   _id: it.equipmentId,
  //   equipmentCode: it.equipmentCode,
  //   equipmentName: it.equipmentName,
  //   equipmentLevel: it.equipmentLevel,
  //   userOrgDepartment: it.userOrgDepartment,
  //   equipmentImage: it.equipmentImage ? `${ipConfig.url(imageUrl)}${it.equipmentImage}?token=${global.__TOKEN_ACCESS__}` : 'no-pic',
  // }));
  return {
    success: true,
    data: response.data,
  };
};
